package cn.edu.scau.cmi.limingben.singleton.controller;

import javafx.fxml.FXML;

import javafx.scene.control.Button;

import javafx.scene.text.Text;

import javafx.scene.control.TextField;
import cn.edu.scau.cmi.limingben.singleton.Chairman;
import javafx.event.ActionEvent;

public class RegisterController {
	@FXML
	private Button create;
	@FXML
	private Text text;
	@FXML
	private TextField view;
	@FXML
	private TextField textfile;

	// Event Listener on Button[#create].onAction
	@FXML
	public void createAction(ActionEvent event) {
		
		String name = textfile.getText();
		Chairman chairman = Chairman.getInstance(name);
		boolean is = Chairman.judge(chairman);
		if(is)
			view.setText("true");
		else
			view.setText("false");
	}
}
